<?php
/* @var $this MeetgiveController */

$this->breadcrumbs=array(
	'综合控制台'=>array($this->pre_module_url.'/index/index'),
	'活动促销'=>array($this->pre_module_url.'/promotion/admin'),
	'团购管理'=>array($this->pre_module_url.'/tuan/admin'),
);
?>


<div class="pro_filter c_f">
	<div class="filter f_l">
		<?php $form=$this->beginWidget('CActiveForm', array(
			'id'=>'CmpPromotion-form',
			'method'=>'get',
			'enableAjaxValidation'=>false,
		)); ?>
			<label class="mr20">状态：</label>
			<?php echo $form->dropDownList($model,'status',$model->getTuanStatus(),array('class'=>'s_ipt w_120 '))?>
			<label class="">公司名称：</label>
			<?php echo $form->textField($model,'company_name',array('class'=>'t_ipt w_250'))?>
			<?php echo CHtml::submitButton(Yii::t('adm','Search'),array('class'=>'mem_bgx mem_btn01'))?>
		<?php $this->endWidget(); ?>
	</div>
</div>

<table class="list_table list_table2" width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<th width="" class="pl15">宝贝信息</th>
		<th width="20%">活动时间</th>
		<th width="15%">店铺名称</th>
		<th width="13%">团购价格</th>
		<th width="10%">状态</th> 
		<th width="12%">操作</th>                                                    
	</tr>
</table>

<?php   
$this->widget('zii.widgets.CListView', array(  
    'dataProvider'=>$model->search(),  
    'itemView'=>'_view',    
    'emptyText'=>'暂时没有数据',  
    'selectAll'=>array('ids[]','id[]'),  
	'htmlOptions'=>array('class'=>'list-view promotion_box '),
	'itemsTagName'=>'table',
	'itemsOptions'=>array('class'=>'list_table list_table2','width'=>'100%','cellpadding'=>0,'cellspacing'=>0),
    'artLink'=>array(  
      	//批量删除 
        array(Yii::t('adm','Delete All'),$this->pre_module_url.'/package/delete','确认上架选中产品！'),  
    ),  
  /*  'batchItem'=>array(  
        //移动到分类  
        $add_drop,  
        //添加到分类  
        $remove_drop,  
    ),  */
    ));  
?>  

<script type="text/javascript">
$('.view').bind('mouseover',function(){
	$(this).next('.box').addClass('hover');
});
$('.view').bind('mouseout',function(){
	$(this).next('.box').removeClass('hover');
});

$('.check_status').bind('click',function(){
	var pid = $(this).parent().parent().find('input').val();
	var ptitle = $(this).parent().parent().find('td').eq(0).find('span').html();
	var cmpname = $(this).parent().parent().find('td').eq(2).html();
	var tprice = $(this).parent().parent().find('td').eq(3).html();
	var str = '<form method="post" id="art_form" action="/manage/tuan/check" style="display: block; " class="boxy-content"><div class="updtitle field" style="width:480px;">'
			+ '<table class="list_table audit_table" width="100%" cellpadding="0" cellspacing="0"><tbody><tr>'
			+ '<input type="hidden" name="ProTuan[zpt_id]" value="'+pid+'"> <input type="hidden" name="ProTuan[zpt_status]" id="ProTuan-zpt_status" value="">'
			+ '<td class="pro tl" width="55%">'+ptitle+'</td>'
			+ '<td width="25%">'+cmpname+'</td>'
			+ '<td width="20%">'+tprice+'</td>'
			+ '</tr></tbody></table><p class="c_999">如果审核不通过，请填写理由</p><textarea class="t_area" name="ProTuan[zpt_nostatus]" style="width:478px; height:80px;"></textarea></div></form>'
		
	art.dialog({
		title:'团购审核',
		content:str,
		cancelValue:'取消',
		cancel:function(){return true;},
		button:[{
            	value: '审核通过',
            	callback: function () {
                	$('#ProTuan-zpt_status').val(2);
                	$('#art_form').submit();
                	return true;
            	}
			},{
            	value: '审核不通过',
            	callback: function () {
                	$('#ProTuan-zpt_status').val(3);
                	$('#art_form').submit();
                	return true;
            	}
			}]
	});

});
</script>
